<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>买家界面公共部分</title>
</head>
<style>
    .t1{
        text-align: center;
    }
</style>
<body>
<!--买家界面页头部分-->
    <header th:fragment="toppublic">
        <nav class="navbar navbar-inverse navbar-fixed-top">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="#">买家中心</a>
                </div>
                <div id="navbar" class="navbar-collapse collapse">
                    <ul class="nav navbar-nav">
                        <li class="active"><a href="#">首页</a></li>
                        <li><a href="#contact">订单</a></li><!--普通框-->
                        <!--普通框-->
                        <li><a href="#contact">购物车</a></li>
                        <!--下拉框-->
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">商品 <span class="caret"></span></a>
                            <ul class="dropdown-menu">
                                <li><a href="#">预定</a></li>
                                <li><a href="#">付款</a></li>
                                <li><a href="#">未付款</a></li>
                                <li><a href="#">代付尾款</a></li>
                                <li role="separator" class="divider"></li><!--横线-->
                                <li class="dropdown-header">收货状态</li>
                                <li><a href="#">已收货</a></li>
                                <li><a href="#">未收货</a></li>
                                <li><a href="#">未发货</a></li>
                            </ul>
                        </li>

                    </ul>
                    <ul class="nav navbar-nav navbar-right">
                        <!--<li><a href="../navbar/">Default</a></li>
                        <li><a href="../navbar-static-top/">Static top</a></li>-->
                        <!--头像-->
                        <li class="dropdown user user-menu">
                            <a class="dropdown-toggle" aria-expanded="false" href="#" data-toggle="dropdown">
                                <img class="user-image" alt="User Image" src="/adminlte/img/user2-160x160.jpg">
                                <span class="hidden-xs"th:text="${name}" id="user_name">1<!--用户名--></span>
                            </a>
                            <ul class="dropdown-menu">
                                <!-- User image -->
                                <li class="user-header">
                                    <img class="img-circle" alt="User Image" src="/adminlte/img/user2-160x160.jpg">

                                    <h2 th:text="${name}"s></h2>
                                </li>
                                <!-- Menu Body -->
                                <li class="user-body">
                                    <!--<div class="row">
                                        <div class="col-xs-4 text-center">
                                           <p>用户名:<span th:text="${name}"></span></p>
                                        </div>
                                        <div class="col-xs-4 text-center">
                                            <p>邮箱:<span th:text="${mail}"></span></p>
                                        </div>
                                        <div class="col-xs-4 text-center">
                                            <p>电话:<span th:text="${tel}"></span></p>
                                        </div>
                                    </div>-->
                                    <table class="col-xs-12">
                                        <tr>
                                            <td class="col-xs-6 t1">用户名</td>
                                            <td class="col-xs-6 t1" th:text="${name}"></td>
                                        </tr>
                                        <tr>
                                            <td class="col-xs-6 t1">邮箱</td>
                                            <td class="col-xs-6 t1" th:text="${email}"></td>
                                        </tr>
                                        <tr>
                                            <td class="col-xs-6 t1">电话</td>
                                            <td class="col-xs-6 t1" th:text="${tel}"></td>
                                        </tr>
                                    </table>
                                    <!-- /.row -->
                                </li>
                                <!-- Menu Footer-->
                                <li class="user-footer">
                                    <div class="pull-left">
                                        <a class="btn btn-default btn-flat" href="/users/alterUsermsg">修改</a>
                                    </div>
                                    <div class="pull-right">
                                        <!--<a class="btn btn-default btn-flat" href="#">Sign out</a>-->
                                        <button class="btn btn-default btn-flat">关闭</button>
                                    </div>
                                </li>
                            </ul>
                        </li>

                        <!--<li class="active"><a href="./">Fixed top <span class="sr-only">(current)</span></a></li>-->
                    </ul>
                </div><!--/.nav-collapse -->
            </div>
        </nav>
        <script>
            //alert(111);
            $(document).ready(function(){
                var s=document.getElementById(user_name);
                alert(s.innerText);
            });
            // var username;
            // username=document.getElementById("user-name");
            // $('body').onload({
            //     type:"GET",
            //     url:"/users/usermsg",
            //     dataField:"user",
            //     dataType:"json",
            //
            //
            //     $('#user-name').val(userid);
            //
            //
            //
            // });
            /*function load(){
                var xmlhttp;
                if (window.XMLHttpRequest)
                {
                    // IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
                    xmlhttp=new XMLHttpRequest();
                }
                else
                {
                    // IE6, IE5 浏览器执行代码
                    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
                }
                xmlhttp.open("GET","/users/usermsg",false);
                xmlhttp.send();
                document.getElementById("user-name").innerHTML=xmlhttp.responseText;
            }*/
        </script>
    </header>
    <footer th:fragment="bottompublic">
        <nav class="navbar navbar-inverse navbar-fixed-bottom">
            <div class="container">
                <!--<p style="text-align: center;font-size: medium">B-team18</p>-->
                <a class="navbar-brand navbar-right" href="#" style="text-align: center">B-team18</a>
            </div>
        </nav>
    </footer>

</body>

</html>